/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fplaton.economics;

import fplaton.ui.oikonomiko;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Konstantinos
 */
public class databaseEconomicsSectionController {
    
    private IEconomicsDao dao;
    
    public databaseEconomicsSectionController(IEconomicsDao dao) {
        this.dao = dao;
    }
    
    
    public boolean updateEconomics(int starterCut, int cutPerKid,
            float firstGradeCost, float secondGradeCost, float thirdGradeCost,
            float fourthGradeCost, float fifthGradeCost, float sixthGradeCost, oikonomiko oikonomiko) {
        try {
            dao.insertOrUpdateEconomicsTable(starterCut, cutPerKid, firstGradeCost,
                    secondGradeCost, thirdGradeCost, fourthGradeCost, fifthGradeCost
                    , sixthGradeCost, this);
            return true;
        } catch (SQLException ex) {
            Logger.getLogger(databaseEconomicsSectionController.class.getName()).log(Level.SEVERE, null, ex);
            return false;
        }
        
    }
    
}
